/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.bc;

import edu.upn.sigemfi.rec.be.CreditoCartera;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Programador
 */
@Stateless
public class CreditoCarteraFacade implements CreditoCarteraFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(CreditoCartera creditoCartera) {
        em.persist(creditoCartera);
    }

    public void edit(CreditoCartera creditoCartera) {
        em.merge(creditoCartera);
    }

    public void remove(CreditoCartera creditoCartera) {
        em.remove(em.merge(creditoCartera));
    }

    public CreditoCartera find(Object id) {
        return em.find(CreditoCartera.class, id);
    }

    public List<CreditoCartera> findAll() {
        return em.createQuery("select object(o) from CreditoCartera as o").getResultList();
    }

}
